home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / sectools / SRS / client / include / functions.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-12  |  5.2 KB  |  168 lines

  1. /* ------ function declarations ------ */
  2.  
  3. #ifndef _FUNCTIONS_H
  4. #define _FUNCTIONS_H
  5.  
  6. __BEGIN_DECLS
  7.  
  8. /* fix implicit declarations */
  9. char *inet_ntoa __P((struct in_addr in));
  10. unsigned long int inet_addr __P((const char *cp));
  11.  
  12. FILE *popen __P((const char *, const char *));
  13. int pclose __P((FILE *));
  14. /* ------------------------- */
  15.  
  16. /* startup code */
  17. void init();       /* basic init.. setup longjmps.. etc. */
  18. void setupFiles(); /* setup necessary files              */
  19.  
  20. void shrMemInit(); /* initialize shared memory           */
  21. /* ------------ */
  22.  
  23. /* connecting/socket code */
  24. void initConn __P((char *primserv, char *secserv));
  25. int  connServ __P((char *host));
  26.  
  27. void setsockopts(int fd, int all); /* setup socket options */
  28. /* ---------------------- */
  29.  
  30. /* configuration */
  31. void config();                    /* reads from syslog config file  */
  32. void printConfig();               /* output the configuration stats */
  33. void sendSysConf();               /* send syslog.conf to the server */
  34. /* ------------- */
  35.  
  36. /* I/O stuff (to/from server/client) */
  37. void send_data __P((char *fmt, ...)); 
  38. void recv_data __P((char *readbuf, int len)); 
  39. /* --------------------------------- */
  40.  
  41.  
  42. /* authentication */
  43. void doAuth();         /* authenticate ourselves with server */
  44. /* -------------- */
  45.  
  46. /* ssl functions */
  47. #ifndef NOSSL
  48. void makeSSLconn(); /* make SSL connection */
  49. #endif
  50. /* ------------- */
  51.  
  52. /* misc. functions */
  53. void usage __P((char *progname)); /* output help/proper usage */
  54.  
  55. void procData();             /* process data from client.. */
  56.  
  57. void getVers();              /* check the current client/server vers  */
  58. void getSubID();             /* get our sub-ID from the server...     */
  59. void getServList();          /* get a list of servers (their IPs)     */
  60.  
  61. void getSRSuser();           /* get uid of SRS user in passwd file    */
  62.  
  63. void putServ __P((int serv, char *buf)); /* parses the IP address     */
  64.  
  65. void updateClient();         /* download a new client (from getVers)  */
  66.  
  67. void createDirs();           /* creates directories for SRS logs...   */
  68.  
  69. void getOkay();              /* get "OKAY" from server */
  70.  
  71. void doServer();             /* figure out what to do about serv */
  72. void nextServer();           /* progress through the server list */
  73.  
  74. void daemonize();            /* daemonize ourselves */
  75. void getArgs __P((int argc, char **argv)); /* get and parse args */
  76.  
  77. int  importInt  __P((char *value)); /* import int for cmd len */
  78. char *exportInt __P((int value));   /* export int for cmd len */
  79.  
  80. void copyLogStruct __P((int srcstruct, int dststruct)); /* copy log struct */
  81.  
  82. void rbindport(); /* bind to the highest free reserved port */
  83. /* --------------- */
  84.  
  85. /* convert facilities/priorities */
  86. char *facValToName(int facility);
  87. int facNameToVal(char *facility);
  88.  
  89. char *priValToName(int priority);
  90. int priNameToVal(char *priority);
  91. /* ----------------------------- */
  92.  
  93. /* streaming stuff */
  94. void initStream();      /* init. streaming stuff like SYSLOGFILE  */
  95. void doStreaming();     /* read data from SYSLOGFILE & send serv. */
  96.  
  97. void doLogging  __P((char *str));  /* parse system log message    */
  98. /* --------------- */
  99.  
  100. /* spooling stuff */                 
  101. void initSpool();   /* initalize spooling   */
  102. void doSpooling();  /* do the spooling loop */ 
  103.  
  104. void forkSpool();   /* fork a spool process */
  105. void killSpooler(); /* kill a spool process */
  106.  
  107. void write_spool __P((char *fmt, ...)); /* write logs to spool file */
  108. /* -------------- */
  109.  
  110. /* ping stuff */
  111. void startPings();        /* fork child to do pinging    */
  112. void checkPings();        /* check for PINGs from server */
  113.  
  114. void killPinger();        /* kill the ping process       */
  115. /* ------------- */
  116.  
  117. /* signal handlers (should all be self-explanatory) */
  118. RETSIGTYPE restart __P((int sig));
  119.  
  120. RETSIGTYPE errTimeout   __P((int sig));
  121. RETSIGTYPE verTimeout   __P((int sig));
  122. RETSIGTYPE subIDTimeout __P((int sig));
  123. RETSIGTYPE listTimeout  __P((int sig));
  124. RETSIGTYPE okayTimeout  __P((int sig));
  125.  
  126. RETSIGTYPE gotNewData __P((int sig));
  127. RETSIGTYPE startUp    __P((int sig));
  128.  
  129. RETSIGTYPE sighandler __P((int sig));
  130.  
  131. RETSIGTYPE dropinfoconn   __P((int sig));
  132. RETSIGTYPE dropstreamconn __P((int stat));
  133. /* --------------- */
  134.  
  135. /* parsing stuff */
  136. void parseSysConf __P((char *str));  /* parse configuration options */
  137.  
  138. int  parseFac __P((char *str, int numfacs)); /* parse facility  */
  139. void parsePri __P((char *str));              /* parse priority  */
  140.  
  141. void parseFile __P((char *str, int didfacs, int numfacs, \
  142.                     char *fac, char *pri));
  143.  
  144. void parseRemHost   __P((char *str)); /* parse the remote hostname  */
  145. void parseNamedPipe __P((char *str)); /* parse the named pipe name  */
  146. /* ------------- */
  147.  
  148. /* debug/error stuff */
  149. void debug(char *fmt, ...); /* reports debugging information */
  150. void error(char *fmt, ...); /* logs errors to the error file */
  151. /* ----------- */
  152.  
  153. /* disconnecting/exiting stuff */
  154. void quit __P((int stat));            
  155.  
  156. void closeLogFiles(); /* close locally spooled files */
  157.  
  158. void freeSharedMem(); /* free/detach shared memmory  */
  159. void freeLogTypes();  /* free the log types          */
  160. void freeServList();  /* free the server list        */ 
  161.  
  162. void doKills();       /* kill parent/child procs     */
  163. /* --------------------------- */
  164.  
  165. __END_DECLS
  166.  
  167. #endif /* _FUNCTIONS_H */
  168.